import QtQuick
import QtQuick.Controls

Rectangle {
    width: 400
    height: 400

    AnimatedSprite {
        id: sprite
        width: 389
        height: 348
        anchors.centerIn: parent
        source: "qrc:/images/hero_attack.png"
        frameCount: 8
        frameWidth: 389
        frameHeight: 348
        frameDuration: 50
        loops: 1
        running: false
    }

    Column {
        anchors.right: parent.right
        anchors.bottom: parent.bottom
        spacing: 10
        padding: 10

        Button {
            text: sprite.running ? "暂停" : "播放"
            onClicked: sprite.running = !sprite.running
        }
    }
}
